<?php



class ChallengeMapBuilder {

	
	const CLASS_NAME = 'lib.model.map.ChallengeMapBuilder';

	
	private $dbMap;

	
	public function isBuilt()
	{
		return ($this->dbMap !== null);
	}

	
	public function getDatabaseMap()
	{
		return $this->dbMap;
	}

	
	public function doBuild()
	{
		$this->dbMap = Propel::getDatabaseMap('propel');

		$tMap = $this->dbMap->addTable('challenge');
		$tMap->setPhpName('Challenge');

		$tMap->setUseIdGenerator(true);

		$tMap->addPrimaryKey('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);

		$tMap->addForeignKey('P1_ID', 'P1Id', 'int', CreoleTypes::INTEGER, 'sf_guard_user', 'ID', false, null);

		$tMap->addForeignKey('P2_ID', 'P2Id', 'int', CreoleTypes::INTEGER, 'sf_guard_user', 'ID', false, null);

		$tMap->addColumn('P1_RANK', 'P1Rank', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('P2_RANK', 'P2Rank', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('P1_POINTS', 'P1Points', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('P2_POINTS', 'P2Points', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addForeignKey('KILLMAIL_ID', 'KillmailId', 'int', CreoleTypes::INTEGER, 'killmail', 'ID', false, null);

		$tMap->addColumn('CREATED_AT', 'CreatedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('IS_VALID', 'IsValid', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('VALIDATION_DT', 'ValidationDt', 'int', CreoleTypes::DATE, false, null);

		$tMap->addColumn('IS_REFUSED', 'IsRefused', 'int', CreoleTypes::INTEGER, false, null);

		$tMap->addColumn('REFUSED_AT', 'RefusedAt', 'int', CreoleTypes::TIMESTAMP, false, null);

		$tMap->addColumn('REASON', 'Reason', 'string', CreoleTypes::LONGVARCHAR, false, null);

		$tMap->addColumn('IS_DRAW', 'IsDraw', 'int', CreoleTypes::INTEGER, false, null);

	} 
} 